
package com.sm.shoplook.domain.system;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

@Table(name = "t_system_permission")
public class Permission implements Serializable {

	@Id
	private Integer id;
	/**
	 * 权限名称
	 */
	@Column(name = "permission_name")
	private String permissionName;
	/**
	 * 权限编码
	 */
	@Column(name = "permission_code")
	private String permissionCode;
	/**
	 * 所属菜单
	 */
	@Column(name = "menu_code")
	private String menuCode;
	@Column(name = "create_time")
	private Date createTime;
	@Column(name = "update_time")
	private Date updateTime;
	@Column(name = "update_user")
	private String updateUser;
	private static final long serialVersionUID = 1L;

	/**
	 * @return id
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * @param id
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * 获取权限名称
	 * @return permission_name - 权限名称
	 */
	public String getPermissionName() {
		return permissionName;
	}

	/**
	 * 设置权限名称
	 * @param permissionName 权限名称
	 */
	public void setPermissionName(String permissionName) {
		this.permissionName = permissionName;
	}

	/**
	 * 获取权限编码
	 * @return permission_code - 权限编码
	 */
	public String getPermissionCode() {
		return permissionCode;
	}

	/**
	 * 设置权限编码
	 * @param permissionCode 权限编码
	 */
	public void setPermissionCode(String permissionCode) {
		this.permissionCode = permissionCode;
	}

	public String getMenuCode() {
		return menuCode;
	}

	public void setMenuCode(String menuCode) {
		this.menuCode = menuCode;
	}

	/**
	 * @return create_time
	 */
	public Date getCreateTime() {
		return createTime;
	}

	/**
	 * @param createTime
	 */
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	/**
	 * @return update_time
	 */
	public Date getUpdateTime() {
		return updateTime;
	}

	/**
	 * @param updateTime
	 */
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	/**
	 * @return update_user
	 */
	public String getUpdateUser() {
		return updateUser;
	}

	/**
	 * @param updateUser
	 */
	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}

	@Override
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(getClass().getSimpleName());
		sb.append(" [");
		sb.append("Hash = ").append(hashCode());
		sb.append(", id=").append(id);
		sb.append(", permissionName=").append(permissionName);
		sb.append(", permissionCode=").append(permissionCode);
		sb.append(", menuCode=").append(menuCode);
		sb.append(", createTime=").append(createTime);
		sb.append(", updateTime=").append(updateTime);
		sb.append(", updateUser=").append(updateUser);
		sb.append("]");
		return sb.toString();
	}

	@Override
	public boolean equals(Object that) {
		if (this == that) {
			return true;
		}
		if (that == null) {
			return false;
		}
		if (getClass() != that.getClass()) {
			return false;
		}
		Permission other = (Permission) that;
		return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
				&& (this.getPermissionName() == null ? other.getPermissionName() == null
						: this.getPermissionName().equals(other.getPermissionName()))
				&& (this.getPermissionCode() == null ? other.getPermissionCode() == null
						: this.getPermissionCode().equals(other.getPermissionCode()))
				&& (this.getMenuCode() == null ? other.getMenuCode() == null
						: this.getMenuCode().equals(other.getMenuCode()))
				&& (this.getCreateTime() == null ? other.getCreateTime() == null
						: this.getCreateTime().equals(other.getCreateTime()))
				&& (this.getUpdateTime() == null ? other.getUpdateTime() == null
						: this.getUpdateTime().equals(other.getUpdateTime()))
				&& (this.getUpdateUser() == null ? other.getUpdateUser() == null
						: this.getUpdateUser().equals(other.getUpdateUser()));
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
		result = prime * result + ((getPermissionName() == null) ? 0 : getPermissionName().hashCode());
		result = prime * result + ((getPermissionCode() == null) ? 0 : getPermissionCode().hashCode());
		result = prime * result + ((getMenuCode() == null) ? 0 : getMenuCode().hashCode());
		result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
		result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
		result = prime * result + ((getUpdateUser() == null) ? 0 : getUpdateUser().hashCode());
		return result;
	}
}
